<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script type="text/javascript" src="../js/vue.js"></script>
</head>
<body>
<div id="root">
</div>
</body>
<script type="text/javascript">
    Vue.config.productionTip = false;
    const student = Vue.extend({
        name: 'student',
        template: `
          <div>
          <h2>学生姓名：{{ name }}</h2>
          <h2>学生年龄：{{ age }}</h2>
          </div>
        `,
        data() {
            return {
                name: '张三',
                age: 18
            }
        },
        computed: {},
        components: {},
        methods: {},
        watch: {},
        filters: {},
        directives: {}
    });
    const school = Vue.extend({
        template: `
          <div>
          <h2>学校名称：{{ name }}</h2>
          <h2>学校地址：{{ address }}</h2>
          <hr>
          <student></student>
          </div>
        `,
        data() {
            return {
                name: "abc",
                address: "深圳"
            }
        },
        components: {
            student
        },
        computed: {},
        methods: {},
        watch: {},
        filters: {},
        directives: {}
    });
    const hello = Vue.extend({
        template: `
          <h1>Hello, {{ name }}</h1>
        `,
        data() {
            return {
                name: "张三"
            }
        },
    });
    const app = Vue.extend({
        template:`
            <div>
            <hello></hello>
            <school></school>
            </div>
        `,
        components: {
            school,
            hello
        },
    });
    new Vue({
        el: '#root',
        template:`
            <app></app>
        `,
        data() {
            return {
                msg: "Hello"
            }
        },
        computed: {},
        components: {
            app
        },
        methods: {},
        watch: {},
        filters: {},
        directives: {}
    });
</script>
</html>